package DesignPatterm.singleResponsibility;

/**
 * 解决了问题,但是此时多增加了一个类,代码显得臃肿了
 */
public class SingleResponsibility2 {
    public static void main(String[] args) {
        Vehicle2 vehicle2 = new Vehicle2();
        vehicle2.run("自行车");

        AirVuhicle2 airVuhicle2 = new AirVuhicle2();
        airVuhicle2.run("飞机");
    }
}

class Vehicle2 {
    public void run(String vehicle) {
        System.out.println(vehicle + "在路上运行...");
    }
}

class AirVuhicle2 {
    public void run(String airVuhicle2) {
        System.out.println(airVuhicle2 + "在天上运行");
    }
}
